
public class Node {

	private char character;
	public int frequency;
	private Node left, parent, right;
	private boolean tag = false;
	private String code;
	
	public Node(char character, int frequency)
	{
		this.character = character;
		this.frequency = frequency;
		left = parent = right = null;
	}
	
	public Node(int frequency, Node left, Node right)
	{
		this.frequency = frequency;
		this.left = left;
		this.right = right;
	}
	
	
	public void setTag(boolean done)
	{
		tag = done;
	}
	
	public boolean getTag()
	{
		return tag;
	}
	
	public void setCode(String number)
	{
		code = number;
	}
	
	public String getCode()
	{
		return code;
	}
	
	public void setLeft(Node left)
	{
		this.left = left;
	}
	
	public Node getLeft()
	{
		return left;
	}
	
	public void setRight(Node right)
	{
		this.right = right;
	}
	
	public Node getRight()
	{
		return right;
	}
	
	public Node getParent()
	{
		return parent;
	}
	
	public void setParent(Node parent)
	{
		this.parent = parent;
	}
	
	public char getLetter()
	{
		return character;
	}
	
	public int getFreq()
	{
		return frequency;
	}

	
}
